<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("admin.productCategory.list")}</title>

<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" />
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/amazeui.min.js"></script>
<script type="text/javascript">
$().ready(function() {

	var $delete = $("#listTable a.delete");
	
	[@flash_message /]

	// 删除
	$delete.click(function() {
		var $this = $(this);
		$.dialog({
			type: "warn",
			content: "${message("admin.dialog.deleteConfirm")}",
			onOk: function() {
				$.ajax({
					url: "delete.htm",
					type: "POST",
					data: {id: $this.attr("val")},
					dataType: "json",
					cache: false,
					success: function(message) {
						$.message(message);
						if (message.type == "success") {
							$this.closest("tr").remove();
						}
					}
				});
			}
		},260,180);
		return false;
	});
});
</script>
	<style type="text/css">
        div.bar .search input{
			height: 20px;
            left: 10px;
		}
	</style>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; ${message("admin.productCategory.list")}
	</div>
    <div class="bar">
        <a href="add.htm" class="iconButton" id="addButton">
            <i class="iconfont icon-anonymous-iconfont1">&nbsp;</i>${message("admin.common.add")}
        </a>
        <a href="javascript:" id="refreshButton" class="iconButton">
            <i class="iconfont icon-shuaxin1">&nbsp;</i>${message("admin.common.refresh")}
        </a>
        <div class="menuWrap">
            <div class="search">
                <form method="post" action="findListByName.action">
                    <input type="text" id="searchValue" name="searchValue" maxlength="200" placeholder="请输入分类名称" value="${searchValue}"/>
                    <button type="submit">&nbsp;</button>
                </form>
            </div>
        </div>
    </div>

	<table id="listTable" class="list">
		<tr>
			<th>
				<span>名称</span>
			</th>
            <th>
                <span>图片</span>
            </th>
			<th>
				<span>排序</span>
			</th>
            <th>
				<span>首页显示</span>
            </th>
			<th>
				<span>操作</span>
			</th>
		</tr>
		[#list productCategoryTree as productCategory]
			<tr>
				<td>
					<span style="margin-left: ${productCategory.grade * 20}px;[#if productCategory.grade == 0] color: #000000;[/#if]">
						${productCategory.name}
					</span>
				</td>
                <td>
					<img class="preImage" src="${productCategory.image!"/resources/admin/images/default.png"}" />
                </td>
				<td>
					${productCategory.order}
				</td>
                <td>
                    [#if productCategory.isTop??]<span class="${productCategory.isTop?string("true", "false")}Icon">&nbsp;</span>[/#if]
                </td>
				<td>
					<a href="edit.htm?id=${productCategory.id}"><i class="iconfont icon-bianji edit-icon" ></i></a>
					<a href="javascript:" class="delete" val="${productCategory.id}"><i class="iconfont icon-shequshanchu del-icon" ></i></a>
				</td>
			</tr>
		[/#list]
	</table>
</body>
</html>